use env_logger;
use tokio;

mod abort_on_drop;
mod net_ifce;
mod raw_udp;
mod raw_pcap;
mod server;
mod settings;
mod proto;

#[tokio::main]
async fn main() {
    let cfg = settings::Settings::instance();

    env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("debug")).init();
    log::info!("starting with config {:#?}", cfg);

    let _srv = server::Server::new(cfg);
    log::info!("server started");

    /*
    let udp_sock = raw_udp::RawUdpSocket::new();
    let src_addr = "192.168.6.53:15053".parse().unwrap();
    let dst_addr = "192.168.6.18:12345".parse().unwrap();
    loop {
        log::info!("send test udp packet");
        udp_sock.send_test_pkt(src_addr, dst_addr);

        tokio::time::sleep(std::time::Duration::from_secs(1)).await;
    }
    */
    futures::pending!();
}
